using System.Collections;
using FlowCanvas;
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;


namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class SwitchHasEmployee : FlowControlNode
    {
        public BBParameter<int> buildingId;
        public BBParameter<int> employeeId;
        public BBParameter<int> level;
        public BBParameter<int> num;
        
        protected override void RegisterPorts()
        {
            var caseTrue = AddFlowOutput("True");
            var caseFalse = AddFlowOutput("False");
            var caseThen = AddFlowOutput("Then");
            AddFlowInput("In", (f) =>
            {
                bool passed = BlueprintUtils.HasEmployee(buildingId.value, employeeId.value,level.value, num.value);
                if (passed)
                {
                    f.Call(caseTrue);
                }
                else
                {
                    f.Call(caseFalse);
                }
                
                f.Call(caseThen);
            });

        }
    }
}